Intermediate R

R语言Intermediate level指令,主要参考datacamp练习和Coursera上JHU课程

some useful instructions

1
2
3
4
5
6
tab可以补全之前输入的命令
上箭头可以返回上一次输入的命令
## logical operator
&:and # && only test the first element;3 < x < 7 to check if x is between 3 and 7 will not work; you'll need 3 < x & x < 7 for that.
|:or #|| only test the first element
!:not #!!only test the first element

conditional statements

1
2
3
4
5
6
7
if(condition) {
expr
} else if(condition2) {
expr2
} else {
expr3
}